<?php

//require_once($_SERVER['DOCUMENT_ROOT'].'/lib/phpmailer/class.phpmailer.php');
class MailSender extends \PHPMailer {

    protected $priority = 3;
    protected $to_name;
    protected $to_email;
    protected $From = null;
    protected $FromName = null;
    protected $Sender = null;
    
public function sendMail(){
    global $site;
    if($site['smtp_mode'] == 'enabled')
    {
        $this->Host = $site['smtp_host'];
        $this->Port = $site['smtp_port'];
        if($site['smtp_username'])
        {
            $this->SMTPAuth = true;
            $this->Username = $site['smtp_username'];
            $this->Password = $site['smtp_password'];
        }
        $this->Mailer  = "smtp";
    }
 
    if(!$this->From)
    {
        $this->From = $site['from_email'];
    }
    if(!$this->FromName)
    {
        $this->FromName = $site['from_name'];
    }
    if(!$this->Sender)
    {
        $this->Sender = $site['from_email'];
    }
    $this->Priority = $this->priority;
}

}

?>
